home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Demos / AppMaker 2.0b3 / Demo AppMaker 1.5 / Demo AppMaker™ / Demo AppMaker™.rsrc / TmpP_1013_Popup < prev    next >
Encoding:
Text File  |  1992-04-08  |  1.1 KB  |  47 lines

  1. %case window field%
  2.     %fieldname%:%        %integer;
  3. %case create%
  4.     %fieldname% := 1;
  5. %case mousein%
  6.     bounds := GetWRect (%itemname%);
  7.     if PtInRect (where, bounds) then begin
  8.         TrackPopup (bounds, %popupID%, %fieldName%);
  9.     end;
  10. %case update%
  11.     bounds := GetWRect (%itemname%);
  12.     UpdatePopup (bounds, %popupID%, %fieldName%);
  13. %case itemNr%
  14.     %DefineItem%
  15. %case dialog field%
  16.     %fieldname%:%        %integer;
  17.     %haveField%
  18. %case init field%
  19.     %fieldname% := 1;
  20. %case auxiliary%
  21.     %set needsRefCon = true%
  22.     {----------}
  23.     Procedure Draw%Itemname%%    %(whichDialog:    DialogPtr;
  24.                                   itemNr:        integer);
  25.     var
  26.         data:            %dlogname%RecPtr;
  27.     Begin
  28.         data := %dlogname%RecPtr (GetWRefCon (whichDialog));
  29.         DrawPopup (itemNr, %popupID%, data^.%fieldName%);
  30.     End; {Draw%Itemname%}
  31.  
  32. %case set%
  33.     SetUserItem (%Itemname%, @Draw%Itemname%);
  34. %case hit%
  35.     %itemname%: begin
  36.             %if not labelName = %
  37.                 InvertLabel (%labelName%);
  38.             %endif%
  39.             DoPopup (%itemname%, %popupID%, %fieldname%);
  40.             %if not labelName = %
  41.                 InvertLabel (%labelName%);
  42.             %endif%
  43.             %if menuName = Sound%
  44.                 PlaySound (%menuName%Menu, %fieldname%);
  45.             %endif%
  46.         end;
  47. %case finish%